1. Field of Invention
The present invention relates generally to the field of providing informational messages in computer applications. More specifically, the present invention is related to providing dynamic message formatting, to allow flexible messaging without requiring time-consuming recompilations or expensive new version releases.
2. Background of the Invention
A significant problem with conventional application development is managing the text associated with phrasing and punctuation of informational messages, such as error messages, generated by conventional computer systems. The problem is so acute that oftentimes a completely new software release is required for making modifications or additions to error messages. One such fundamental change requiring a new release, for example, is a change in company name because it can require changes to so many messages.
Conventional systems do not allow such changes to be made dynamically. Some conventional systems code the error messages. That is, a particular error is defined by a error message number. The actual text of the error message is stored in an error message database. When a particular error message is required, the application program simply pulls the called for error message from the database. The text of the error message can be changed while it is in the database. However, the text, once changed, remains static. Every time that error message is called for, it prints the same message text. This is undesirable as it is often the case that arbitrarily generated messages are preferred. For example, in application development and maintenance after release, more detailed messages regarding the execution of the application are preferred. However, the release of that application is likely to only provide minimal messaging, as the end user is generally not interested in detail status messages.
The present invention allows message generation to be performed dynamically, thereby precluding the requirement of hardcoded messages. Preferably, messages are created and stored in a message file. In the preferred embodiment of the present invention, the messages in the message file are loaded into computer memory at runtime to preclude heavy file I/O in the runtime environment.
Formatting tags are provided in the message which act as substitutes for various data to be placed in the message. For example, it might be desirable to place the application name, line number, code segment and status of the stack in the message. An exemplary message form stored in the message file is xe2x80x9cError in %A line %L, code %R stack %Sxe2x80x9d which would tell the message generator of the present invention to print out a message of the given form with the application name substituted for the %A, line number substituted for the %L, file name of the code segment substituted for the %R and stack status substituted for the %S. Thus, unlike conventional systems there is no predetermined hardcoded message. Rather, messages are built xe2x80x9con-the-flyxe2x80x9d using the formatting tags to provide the desired information in the message. Consequently message content can be changed dynamically by changing the formatting tags in a particular message.
The form of the message containing the formatting tags is arbitrary and can be specified by the user in any way desired. In addition, each error message is preferably time stamped and printed with a message number as well as logged. The present invention works for any messages that might be-printed for a system operator including for example, error messages and notification messages.
Thus, one object of the present invention is to allow standard applications to have dynamic messages, such that no software release, i.e., no change in the executable code, is required to change the content of the error message that can be printed out for a given error event.
Another object of the present invention is to allow for generation of dynamic notification messages that inform a system operator of the status of the system or of certain events that happen during an application""s execution.